var vue2b = new Vue({
	el: "body",
	data: {
		userb: "",
		top: ""
	},
	methods: {
		change: function(e) {
			//不登录无法浏览此页面
			var curr = AV.User.current();
			if(curr) {
				console.log("欢迎" + curr.attributes.username + "的光临");
				location.href = "xinxia.html?id=" + e;
			} else {
				console.log("未登录");
				location.href = "../init/init.html?page=2"
			};
		}
	},
	created: function() {
		var APP_ID = 'Wx3JTgmqBaARoWCaGI96AM9h-gzGzoHsz';
		var APP_KEY = 'TrVpB16Og6Yac9u3BoiUy4hT';
		AV.init({
			appId: APP_ID,
			appKey: APP_KEY
		});
		//不登录无法浏览此页面
		var curr = AV.User.current();
		if(curr) {
			console.log("欢迎" + curr.attributes.username + "的光临");
		} else {
			console.log("未登录");
		};
		var cql = 'select * from otherUser where class = "2"';
		AV.Query.doCloudQuery(cql).then(function(data) {
			// results 即为查询结果，它是一个 AV.Object 数组
			vue2b.userb = data.results;
			console.log(vue2b.userb);
			console.log(data.results);
		}, function(error) {
			console.log("查询失败");
		});
	}
})